import React, {Component} from 'react';
import {withStore} from '../store/storeUtils';
import {Icon, NavBar} from 'antd-mobile';
import {withRouter} from 'react-router-dom';

class AppHeader extends Component {
    onBack = () => {
        console.log(this.props.history.goBack());
    };

    render() {
        const {storeState} = this.props;
        return (
            <NavBar className="app-header" mode="light" icon={<Icon type="left"/>} onLeftClick={this.onBack}>
                {storeState.ui.title}
            </NavBar>
        );
    }
}

export default withStore(withRouter(AppHeader));